<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>中国移动虚拟商品</title>
<script type="text/javascript"
	src="/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="/js/bootstrap.js"></script>
<script src="/js/getCurrentDate.js"
	type="text/javascript"></script>
<link
	href="/css/bootstrap.css"
	rel="stylesheet">
	<script src="/js/paycommon.js"></script>
	<link rel="stylesheet" type="text/css" href="/css/paycomm.css">
	<!--[if lt IE 9]>
    	<script src="/js/respond.js"></script>
	<![endif]-->
<script type="text/javascript">
	$(document).ready(function() {
		var curDate = getCurDate();
		var curDateTime = getCurDateTime();
		var ordernb = "0069" + curDateTime + (Math.random()+"").substring(2,13);
		$("#OrderNo").val(ordernb);
		$("#ReqDate").val(curDate);
	});
	//提交form
	function checkAndSubmit() {
		var sign = $("#SignValue").val();
		if(sign == ""){
			console.info("当前未选择商品,请先选择商品");
			$("#noselect").text("当前未选择商品,请先选择商品");
			 return false;
		}
		//提交form
			document.hform.action = "../cashier/order";
			document.hform.submit();
	}

	function Sign() {
		if (true) {
			$.ajax({
				url : 'sign.action',
				type : 'post',
				dataType : "text",
				data : $('#hform').serialize(),
				cache : false,
				async : false,
				success : function(result) {
					$("#SignValue").val(result);
				}
			});
		}
	}
</script>
<body>

<div class="pay-top">
		<div class="top-content">
			<div class="top-left">
				<img src="/img/icon_logo.png" />
				<span>中国移动虚拟商品</span>
			</div>
		</div>
	</div>
<div class="pay-type">
		<div class="check-type">
			<div class="type-title">请选择支付商品&nbsp&nbsp&nbsp&nbsp<span id="noselect" class="main-money"></span></div>
			
			<div class="type-list">
				<table cellpadding="0" cellspacing="0" class="type-list-tab">
					<tr>
						<td id="${paytype}" onclick="Sign()">
							<div>
								<img src="/img/charge.png ">
								<img src="/img/icon_Selected.png" class="check-pay-img">
								充值0.1元
							</div>
						</td>
						<td id="${paytype}" onclick="Sign()">
							<div>
								<img src="/img/charge.png">
								<img src="/img/icon_Selected.png" class="check-pay-img">
								充值1元
							</div>
						</td>
						<td id="${paytype}" onclick="Sign()">
							<div>
								<img src="/img/charge.png">
								<img src="/img/icon_Selected.png" class="check-pay-img">
								充值10元
							</div>
						</td>
						</tr>
						<tr>
						<td id="${paytype}" onclick="Sign()">
							<div>
								<img src="/img/charge.png">
								<img src="/img/icon_Selected.png" class="check-pay-img">
								充值30元
							</div>
						</td>
						<td id="${paytype}" onclick="Sign()">
							<div>
								<img src="/img/charge.png">
								<img src="/img/icon_Selected.png" class="check-pay-img">
								充值50元
							</div>
						</td>
						<td id="${paytype}" onclick="Sign()">
							<div>
								<img src="/img/charge.png">
								<img src="/img/icon_Selected.png" class="check-pay-img">
								充值100元
							</div>
						</td>
					</tr>
				</table>
				<ul>
				   <li id="${paytype}" onclick="Sign()">
					   <img src="/img/charge.png">
					   <img src="/img/icon_Selected.png" class="check-pay-img">
					        充值0.1元
				   </li>
				   <li id="${paytype}" onclick="Sign()">
					   <img src="/img/charge.png">
					   <img src="/img/icon_Selected.png" class="check-pay-img">
					        充值50元
				   </li>
				   <li id="${paytype}" onclick="Sign()">
					   <img src="/img/charge.png">
					   <img src="/img/icon_Selected.png" class="check-pay-img">
					        充值100元
				   </li>
				</ul>
			</div>
			
		</div>
		<div class="go-pay">
			<button onClick="checkAndSubmit()" id="btgopay">去支付</button>
		</div>
	</div>
	<div class="pay-bottom">
		<div>Copyright©2004-2016 中国移动 版权所有</div>
	</div>
	<form class="form-horizontal" name="hform" method="post" id="hform">
		<table class="table table-striped">
			<tr>
				<td>
					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">订单号:</label> -->
						<div class="controls">
							<input type="hidden" id="OrderNo" name="OrderNo"/>
						</div>
					</div>
					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">交易编码:</label> -->
						<div class="controls">
							<input type="hidden" id="ActivityCode" name="ActivityCode" value="U104_001"/>
						</div>
					</div>

					<!-- <div class="control-group">
						<label class="control-label" for="inputEmail">买家ID:</label>
						<div class="controls">
							<input type="hidden" id="BuyerID" name="BuyerID" value="WXBuyerID"/>
						</div>
					</div> -->

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">中国移动用户标识类型:</label> -->
						<div class="controls">
							<input type="hidden" id="IDType" name="IDType" value="01" />
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">中国移动用户号码:</label> -->
						<div class="controls">
							<input type="hidden" id="IDValue" name="IDValue" value="13510434519" />
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">订单总金额:</label> -->
						<div class="controls">
							<input type="hidden" id="OrderMoney" name="OrderMoney" value="1"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">用户支付金额:</label> -->
						<div class="controls">
							<input type="hidden" id="Payment" name="Payment" value="1"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">商户赠送金额:</label> -->
						<div class="controls">
							<input type="hidden" id="Gift" name="Gift" value="0"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">商户活动编号:</label> -->
						<div class="controls">
							<input type="hidden" id="MerActivityID" name="MerActivityID" value=""/>
						</div>
					</div>

					<!-- <div class="control-group">
						<label class="control-label" for="inputEmail">支付方式:</label>
						<div class="controls">
							<select name="PaymentType">
								<option value="ALIPAY-WEB">ALIPAY-WEB</option>
								<option value="ALIPAY-WAP">ALIPAY-WAP</option>
								<option value="ALIPAY-BANK">ALIPAY-BANK</option>
								<option value="WEIXIN-JSAPI">WEIXIN-JSAPI</option>
								<option value="WEIXIN-NATIVE">WEIXIN-NATIVE</option>
								<option value="UNIONPAY-GATEWAY">UNIONPAY-GATEWAY</option>
								<option value="UNIONPAY-WAP">UNIONPAY-WAP</option>
								<option value="UNIONPAY-WAP">UNIONPAY-WAP</option>
							</select>
						</div>
					</div>
                    <div class="control-group">
						<label class="control-label" for="inputEmail">网银支付银行代码:</label>
						<div class="controls">
							<input type="text" id="DefaultBank" name="DefaultBank" value=""/>
						</div>
					</div> -->
					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">支付限制:</label> -->
						<div class="controls">
							<input type="hidden" id="PaymentLimit" name="PaymentLimit" value=""/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">产品编号:</label> -->
						<div class="controls">
							<input type="hidden" id="ProductID" name="ProductID" value="111111"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">产品名称:</label> -->
						<div class="controls">
							<input type="hidden" id="ProductName" name="ProductName" value="充值"/>
						</div>
					</div>
				</td>
				<td>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">产品描述:</label> -->
						<div class="controls">
							<input type="hidden" id="ProductDesc" name="ProductDesc" value="在线支付充值"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">商品展示网址:</label> -->
						<div class="controls">
							<input type="hidden" id="ProductURL" name="ProductURL" value="http://192.168.59.200/ProductShow"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">订单结果通知URL:</label> -->
						<div class="controls">
							<input type="hidden" id="NotifyURL" name="NotifyURL" value="http://127.0.0.1:8086/payprod-format/merchant/notify.action"/>
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">支付成功返回URL:</label> -->
						<div class="controls">
							<input type="hidden" id="ReturnURL" name="ReturnURL" value="http://59.40.182.77:8080/payprod-format/merchant/return"/>
						</div>
					</div>

					<!-- <div class="control-group">
						<label class="control-label" for="inputEmail">客户端IP:</label>
						<div class="controls">
							<input type="text" id="ClientIP" name="ClientIP" value="192.168.1.100"/>
						</div>
					</div> -->

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">商户自定义参数:</label> -->
						<div class="controls">
							<input type="hidden" id="CustomParam" name="CustomParam" value="key=valuue|key2=value2"/>
						</div>
					</div>

                  
					<!-- <div class="control-group">
						<label class="control-label" for="inputEmail">微信用户标识:</label>
						<div class="controls">
							<input type="text" id="WeiXinOpenId" name="WeiXinOpenId" value="">
						</div>
					</div> -->

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">微信公众号ID:</label> -->
						<div class="controls">
							<input type="hidden" id="WeiXinAppId" name="WeiXinAppId"  value="wx9033126e8e910866">
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">CerId:</label> -->
						<div class="controls">
							<input type="hidden" value="798055fe" name="CerID" id="CerID" />
						</div>
					</div>

					<div class="control-group">
						<!-- <label class="control-label" for="inputEmail">签名数值:</label> -->
						<div class="controls">
							<input type="hidden" id="SignValue" name="SignValue" value=""/>
						</div>
					</div>
				</td>
			</tr>
			<!-- <tr>
				<td>
					<div class="control-group">
						<div class="controls">
							<label class="checkbox"> <input type="checkbox"
								id="createSign" onClick="Sign()">生成签名
							</label>
						</div>
					</div>
				</td>
				<td>
					<div class="controls">
						<button type="button" class="btn btn-primary"
							onClick="checkAndSubmit()">提交</button>
					</div>
				</td>
			</tr> -->
		</table>
	</form>
	<script>

		/* $(document).ready(function() {
			    init("${orderBean.clientType}","${orderBean.payTypeList}");
			}); */
		
		var i =0 ;
		$(".order-infos").on("click",function(){
			if(i == 0){
				$(this).addClass("bg-up");
				$(".infos-content").show();
				i = 1;
			}else{
				
				$(this).removeClass("bg-up");
				$(".infos-content").hide();
				i = 0;
			}
		})
		
		$(".more-bank").nextAll().hide();
		
		$(".more-bank").on("click",function(){
			$(this).nextAll().show();
			$(this).remove();
		})
		
		//pc，ipad选中效果
		var _div = $(".type-list-tab td div");
		var _bank = $(".bank-list li");
		
		_div.on("click",function(){
			_bank.find(".check-pay-img").remove();
			_bank.removeClass("check-pay-bg");
			_div.find(".check-pay-img").hide();
			_div.removeClass("check-pay-bg");
			$(this).find(".check-pay-img").show();
			$(this).addClass("check-pay-bg");
		})
		
		_bank.on("click",function(){
			_div.find(".check-pay-img").hide();
			_div.removeClass("check-pay-bg");
			_bank.find(".check-pay-img").remove();
			_bank.removeClass("check-pay-bg");
			$(this).addClass("check-pay-bg");
			$(this).append('<img src="/img/icon_Selected.png" class="check-pay-img show-img">');
		})
		
		
		//手机选中效果	
		var _li = $(".type-list ul li");
		_li.on("click",function(){
			_li.find(".check-pay-img").hide();
			_li.removeClass("check-pay-bg");
			$(this).find(".check-pay-img").show();
			$(this).addClass("check-pay-bg");
		})
		
	</script>
</body>
</html>
